image: {{ .ModuleName }}/{{ .ImageName }}
fromImage: common/shell-operator
import:
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /relocate
  to: /
  before: setup
  includePaths:
    - '**/*'
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /usr/lib/python3
  to: /usr/lib/python3
  before: setup
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /usr/lib64/python3
  to: /usr/lib64/python3
  before: setup
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /usr/lib64/python3.9
  to: /usr/lib64/python3.9
  before: setup
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /usr/local/lib/python3
  to: /usr/local/lib/python3
  before: setup
git:
- add: /{{ $.ModulePath }}modules/300-{{ $.ModuleName }}/images/{{ $.ImageName }}/hooks
  to: /hooks
  stageDependencies:
    install:
    - '**/*'

---
{{- $pythonBinaries := "/usr/bin/python3" }}
artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
from: {{ $.Images.BASE_ALT_DEV }}
git:
- add: /{{ $.ModulePath }}modules/300-{{ $.ModuleName }}/images/{{ $.ImageName }}/requirements.txt
  to: /requirements.txt
  stageDependencies:
    install:
    - '**/*'
shell:
  install:
    - export SOURCE_REPO={{ .SOURCE_REPO }}
    - git clone --depth 1 {{ $.SOURCE_REPO }}/python-modules/wheels /wheels
    - pip3 install -f file:///wheels --no-index -r /requirements.txt
    - /binary_replace.sh -i "{{ $pythonBinaries }}" -o /relocate
